package com.yiyibook.service.impl;

import com.yiyibook.entity.ShoppingCar;
import com.yiyibook.mapper.ShoppingCarMapper;
import com.yiyibook.service.ShoppingCarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 〈功能简述〉
 *
 * @author xun.gong@hand-china.com
 * @date 2019/10/15
 */
@Service
public class ShoppingCarServiceImpl implements ShoppingCarService {

    @Autowired
    private ShoppingCarMapper shoppingCarMapper;

    @Override
    public ShoppingCar selectBookById(ShoppingCar shoppingCar) {
        return shoppingCarMapper.selectById(shoppingCar);
    }

    @Override
    public int updateByCondition(ShoppingCar sc) {
        return shoppingCarMapper.updateByPrimaryKeySelective(sc);
    }

    @Override
    public int insert(ShoppingCar shoppingCar) {
        return shoppingCarMapper.insertSelective(shoppingCar);
    }

    @Override
    public ShoppingCar selectByMemberId(Integer memberId) {
        return shoppingCarMapper.selectByMemberId(memberId);
    }

    @Override
    public int updateByCarId(ShoppingCar shoppingCar) {
        return shoppingCarMapper.updateByPrimaryKeySelective(shoppingCar);
    }

    @Override
    public int deleteById(Integer shopCarId) {
        return shoppingCarMapper.deleteByPrimaryKey(shopCarId);
    }
}
